package com.web;


import com.pojo.dto.Message;
import com.pojo.vo.CFishingPondVo;
import com.service.CFishingPondService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@RestController
public class CFishingPondController {
    @Autowired
    CFishingPondService cFishingPondService;

    @RequestMapping(value = "/cfishingponds", method = RequestMethod.POST)
    public Message<List<CFishingPondVo>> findList(CFishingPondVo cFishingPondVo) {
        return cFishingPondService.list(cFishingPondVo);
    }

    @RequestMapping(value = "/cfishingponds/selectone", method = RequestMethod.POST)
    public Message<CFishingPondVo> find(Long id) {
        return cFishingPondService.selectOne(id);
    }

    @RequestMapping(value = "/cfishingponds/add", method = RequestMethod.POST)
    public Message<CFishingPondVo> add(CFishingPondVo cFishingPondVo) {
        return cFishingPondService.add(cFishingPondVo);
    }

    @RequestMapping(value = "/cfishingponds/update", method = RequestMethod.POST)
    public Message<CFishingPondVo> update(CFishingPondVo cFishingPondVo) {
        return cFishingPondService.edit(cFishingPondVo);
    }

    @RequestMapping(value = "/cfishingponds/delete/{id}", method = RequestMethod.POST)
    public Message<CFishingPondVo> delete(@PathVariable Long id) {
        return cFishingPondService.delete(id);
    }

}
